ccR.Add_Rotation(
	1,
	"CC_DK_Blood",
	"lvl90-100 for levelling/dungeons",
	"CC_DK_Blood_Talents",
	"CC_DK_Blood_Abilities",
	"CC_DK_Blood_Features",
	"CC_DK_Blood_Setup"
)

function CC_DK_Blood()
	if ccR.Target.Is.Attackable() then
		if ccR.Player.Is.InCombat() then
		-- Abilities
			-- Blood Only -- Death_Knight\Blood\Functions.lua
				if ccR.Var("Bone_Shield") then ccR.Death_Knight.Blood.Bone_Shield() end
				if ccR.Var("Vampiric_Blood") then ccR.Death_Knight.Blood.Vampiric_Blood(ccR.Var("Vampiric_Blood_Health")) end
				if ccR.Var("Rune_Tap") then ccR.Death_Knight.Blood.Rune_Tap(ccR.Var("Rune_Tap_Health")) end 
				if ccR.Var("Dancing_Rune_Weapon") then ccR.Death_Knight.Blood.Dancing_Rune_Weapon(ccR.Var("Dancing_Rune_Weapon_Health")) end
				ccR.Death_Knight.Blood.Death_Strike(3, 80) 
			if ccR.Var("Mind_Freeze") then ccR.Death_Knight.Mind_Freeze(ccR.Var("Mind_Freeze_Count")) end
			if ccR.Var("Strangulate") then ccR.Death_Knight.Strangulate(ccR.Var("Strangulate_Count")) end 
		-- Functions -- Death_Knight\Functions.lua
			ccR.Death_Knight.Death_And_Decay_On_Proc(1) 
			ccR.Death_Knight.Blood_Boil_On_Proc(1)
			if ccR.Var("Dark_Succor") then ccR.Death_Knight.Dark_Succor(ccR.Var("Dark_Succor_Health")) end
			if ccR.Var("Empower_Rune_Weapon") then if (not ccR.Var("Empower_Rune_Weapon_BossOnly") or ccR.Var("Empower_Rune_Weapon_BossOnly") and (ccR.Player.Is.Solo() or ((ccR.Player.Is.InDungeon() or ccR.Player.Is.InRaid()) and ccR.Target.Is.Boss()))) then ccR.Death_Knight.Empower_Rune_Weapon() end end
			if ccR.Var("Icebound_Fortitude") then ccR.Death_Knight.Icebound_Fortitude(ccR.Var("Icebound_Fortitude_Health")) end
			if ccR.Var("Anti_Magic_Shell") then ccR.Death_Knight.Anti_Magic_Shell() end 
			if ccR.Var("Lichborne_Healing") then ccR.Death_Knight.Lichborne_Healing(ccR.Var("Lichborne_Healing_Health"), 30) end
		-- Talents -- Death Knight\Talents.lua
			-- Tier 1
			if ccR.Var("Plague_Leech") then ccR.Death_Knight.Talent.Plague_Leech() end
			if ccR.Var("Unholy_Blight") then  ccR.Death_Knight.Talent.Unholy_Blight(ccR.Var("Unholy_Blight_Count")) end
			-- Tier 3
			if ccR.Var("Lichborne") then ccR.Death_Knight.Talent.Lichborne() end
			-- Tier 4
			if ccR.Var("Blood_Tap") then ccR.Death_Knight.Talent.Blood_Tap(ccR.Var("Blood_Tap_Count")) end
			-- Tier 5
			if ccR.Var("Death_Pact") then ccR.Death_Knight.Talent.Death_Pact(ccR.Var("Death_Pact_Health")) end
			if ccR.Var("Death_Siphon") then ccR.Death_Knight.Talent.Death_Siphon(ccR.Var("Death_Siphon_Health")) end
			if ccR.Var("Conversion") then ccR.Death_Knight.Talent.Conversion(ccR.Var("Conversion_Health")) end
			-- Tier 6
			if ccR.Var("Gorefiends_Grasp") then ccR.Death_Knight.Talent.Gorefiends_Grasp(ccR.Var("Gorefiends_Grasp_Count")) end
			if ccR.Var("Remoreseless_Winter") then ccR.Death_Knight.Talent.Remorseless_Winter(ccR.Var("Remoreseless_Winter_Count")) end
			if ccR.Var("Desecrated_Ground") then ccR.Death_Knight.Talent.Desecrated_Ground() end
			-- Tier 7
			if ccR.Var("Breath_of_Sindragosa") then ccR.Death_Knight.Talent.Breath_of_Sindragosa(ccR.Var("Breath_of_Sindragosa_Count")) end
		end
		if ccR.Player.Is.Facing("target") then
			ccR.Start_Attack()
			if ccR.Var("Death_Grip") then if ((ccR.Var("Death_Grip_InLFG") and (ccR.Player.Is.InDungeon() or ccR.Player.Is.InRaid() or ccR.Player.Is.Solo())) or (not ccR.Var("Death_Grip_InLFG") and ccR.Player.Is.Solo())) then ccR.Death_Knight.Death_Grip() end	end
			ccR.Death_Knight.Death_And_Decay(3) 
			-- Rotation
			if ccR.Var("Soul_Reaper") then ccR.Death_Knight.Features.Soul_Reaper(35) end
			if ccR.Spell.CanAttack(DEATH_COIL) and ccR.Player.Runic_Power() >= 70 then ccR.Cast.Attack(DEATH_COIL) end
			if ccR.Player.Has.Talent(NECROTIC_PLAGUE) then
				if ccR.Spell.CanAttack(OUTBREAK) and not ccR.Target.Has.MyDebuff(NECROTIC_PLAGUE_DEBUFF) then ccR.Cast.Attack(OUTBREAK) end
				ccR.Death_Knight.Blood_Boil(3, "onlyBloodorDeath")
				ccR.Death_Knight.Blood_Boil(5, "anyRune")
				if ccR.Spell.CanAttack(ICY_TOUCH) and not ccR.Target.Has.MyDebuff(NECROTIC_PLAGUE_DEBUFF) then ccR.Cast.Attack(ICY_TOUCH) end
				if ccR.Spell.CanAttack(PLAGUE_STRIKE) and not ccR.Target.Has.MyDebuff(NECROTIC_PLAGUE_DEBUFF) then ccR.Cast.Attack(PLAGUE_STRIKE) end
			else
				if ccR.Spell.CanAttack(OUTBREAK) and (not ccR.Target.Has.MyDebuff(FROST_FEVER) or not ccR.Target.Has.MyDebuff(BLOOD_PLAGUE)) then ccR.Cast.Attack(OUTBREAK) end
				ccR.Death_Knight.Blood_Boil(3, "onlyBloodorDeath")
				ccR.Death_Knight.Blood_Boil(5, "anyRune")
				if ccR.Spell.CanAttack(ICY_TOUCH) and not ccR.Target.Has.MyDebuff(FROST_FEVER) then ccR.Cast.Attack(ICY_TOUCH) end
				if ccR.Spell.CanAttack(PLAGUE_STRIKE) and not ccR.Target.Has.MyDebuff(BLOOD_PLAGUE) then ccR.Cast.Attack(PLAGUE_STRIKE) end
			end
			if ccR.Spell.CanAttack(DEATH_STRIKE) then ccR.Cast.Attack(DEATH_STRIKE)
			elseif ccR.Spell.CanAttack(DEATH_COIL) then ccR.Cast.Attack(DEATH_COIL)
			end
			--ccR.Death_Knight.Features.Soul_Reaper(100, "runeOnly") -- Soul Reaper any around you with 100% health or less and only Blood rune
			ccR.Death_Knight.Blood_Boil(1, "onlyBlood") -- Blood boil on 1+ enemies and if any Blood rune is available
		end
	end	
end